<?php

/* @project : Template
 * @auther  : 青云
 * @date    : 2018/1/10
 * @desc    : 角色模型
 */

namespace app\common\model;

use think\Model;

class RoleAdmin extends Model
{
    function getRoleListByAdminId($user_id)
    {
        $where[] = array('admin_id', 'eq', $user_id);
        $role_list = $this->where($where)->select()->toArray();
        return $role_list;
    }

    /*查询单条数据*/
    public function singleData($where = [], $field='*')
    {
        $result = $this::where($where)->field($field)->find();
        return $result;
    }
}
